package net.da.gwt.server;

import net.da.gwt.client.dto.AA01GwtRequest;
import net.da.gwt.client.dto.AA01GwtResponse;
import net.da.gwt.client.dto.AA02GwtRequest;
import net.da.gwt.client.dto.AA02GwtResponse;
import net.da.gwt.client.service.AAService;
import net.da.processor.ProcessorProvider;
import net.da.processor.a.A01Processor;
import net.da.processor.a.A02Processor;
import net.da.processor.a.io.A01Request;
import net.da.processor.a.io.A01Response;
import net.da.processor.a.io.A02Request;
import net.da.processor.a.io.A02Response;

import com.google.gwt.user.server.rpc.RemoteServiceServlet;

public class RemoteServiceServletImpl0 extends RemoteServiceServlet implements AAService {

		
	private ProcessorProvider factory;
	
	RemoteServiceServletImpl0() {
		factory = ProcessorProvider.getInstance();
	}
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	public AA01GwtResponse a01(AA01GwtRequest gwtRequest) {
		
		A01Processor processor = factory.getA01Processor();
		A01Request request = new A01Request();
		request.setField01(gwtRequest.getField01());
		request.setField02(gwtRequest.getField02());				
		A01Response response = processor.processRequest(request);
		AA01GwtResponse gwtResponse = new AA01GwtResponse();		
		gwtResponse.setField01(response.getField01());
		gwtResponse.setField03(response.getField03());		
		return gwtResponse;
	}

	public AA02GwtResponse a02(AA02GwtRequest gwtRequest) {
		
		A02Processor processor = factory.getA02Processor();
		A02Request request = new A02Request();
		request.setField01(gwtRequest.getField01());
		request.setField02(gwtRequest.getField02());				
		A02Response response = processor.processRequest(request);
		AA02GwtResponse gwtResponse = new AA02GwtResponse();		
		gwtResponse.setField01(response.getField01());
		gwtResponse.setField02(response.getField02());		
		return gwtResponse;
	}

}
